﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace Automatic.Base
{
    class NotifyBase : INotifyPropertyChanged
    {
        /// <summary>
        /// 实现属性变化接口
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// 属性变化后实现通知
        /// </summary>
        /// <param name="name">属性名</param>
        public void SetProperty<T>(ref T feild,T value, [CallerMemberName] string name = null)
        {
            feild = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }
    }
}
